#/usr/bin/python

shoplist = ['apple', 'mango', 'carrot', 'banana']

#Indexing or 'Subscription' operation
print 'Item 0 is ', shoplist[0]
print 'Item 1 is ', shoplist[1]
print 'Item 2 is ', shoplist[2]
print 'Item 3 is ', shoplist[3]
print 'Item -1 is ', shoplist[-1]
print 'Item -2 is ', shoplist[-2]

#Slicing on a list
print 'Item 1 to 3', shoplist[1:3]
print 'Item 2 to end', shoplist[2:]
print 'Item 1 to -1', shoplist[1:-1]
print 'Item start to end', shoplist[:]

#Slicing on a list
name = 'swaroop'
print 'characters 1 to 3 is',name[1:3]
print 'characters 2 to end is',name[2:]
print 'characters 1 to -1 is',name[1:-1]
print 'characters start to end is',name[:]
